#pragma once
#include"Object.h"
#include"MoveObject.h"
#include "PlayerState.h"
#include "GameDefine.h"
class Camera;
class Box;
class PlayerState;
class OnGroundState;
class OnSpaceState;
class OnWaterState;
class Sprite;

class Player :
	public Object, public MoveObject
{	
	BULLET_ID _bulletID;	
	PlayerState* _state;
	OnGroundState* _onGroundState;
	OnWaterState* _onWaterState;
	OnSpaceState* _onSpaceState;	
	PLAYER_STATE _enumState;//
	PLAYER_STATE _preState;	
	float _remainTime;
	Sprite* _dieLeft;
	Sprite* _dieRight;
	int _endOfWorld;
public:
	Player(Box* box);			

	void update();

	void render();		

	void setPlayerBox();

	void setSprite(Sprite* s);

	void jumpUp();
	void jumpUp(float h);
	void goDie();
	void jumpDown();

	void set_vx(float vx);

	void setState(PlayerState* state);

	Box* getPlayerBox();

	void setBulletID(BULLET_ID b);

	BULLET_ID getBulletID();

	bool isAlive();
	//shoot(position.x, position.y, angle);
	void shoot(int pos_x, int pos_y, float angle);
	bool timeDelay(float time);

	Player();
	~Player();

	virtual Box* getCollisionBox();
	void setCollisionBox(Box* box);
};				

